FROM node:16

WORKDIR /web/
COPY . .

RUN npm install

# 使用npm run build命令打包web项目
RUN npm run build

FROM nginx:alpine
LABEL MAINTAINER="18810437307@163.com"

COPY ./my.conf /etc/nginx/conf.d/my.conf
COPY --from=0 /web/pub /usr/share/nginx/html
RUN cat /etc/nginx/nginx.conf
RUN cat /etc/nginx/conf.d/my.conf
RUN ls -al /usr/share/nginx/html
